package org.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Notification {
    /**
     * 通知ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 员工ID
     */
    private Long userId;

    /**
     * 通知内容
     */
    private String message;

    /**
     * 通知标题
     */
    private String title;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

    private Long appId;


    @TableField(exist = false)
    private String nickName;

    @TableField(exist = false)
    private String avatarUrl;


    public Notification() {

    }

    public Notification(Long userId, String message,String title,Long appId) {
        this.userId = userId;
        this.message = message;
        this.title = title;
        this.createTime = LocalDateTime.now();
        this.appId=appId;

    }
}
